package leetcode;

public class Test0191 {
    public int hammingWeight(int n) {
        int mask=0;
        int count=0;
        for(int i=0;i<32;i++){
            if((n & mask)!=0){
                count++;
            }
            mask<<=1;
        }
        return count;
    }
}
